#ifndef UTILITIES_H
#define UTILITIES_H

#include "Array.h"


//-----------------------------------------------------------------------
//   typedefs
//-----------------------------------------------------------------------

// A pointer to a function that computes the spatial derivatives of
// the interpolation matrix. This is the so-called B-matrix.

typedef void        (*ShapeGradsFunc)

  ( const Matrix&       b,
    const Matrix&       g );


//-----------------------------------------------------------------------
//   constants
//-----------------------------------------------------------------------

// An integer array that maps the number of spatial dimensions (1, 2,
// or 3) to the number of strain/stress components.

extern const int      STRAIN_COUNTS[4];


//-----------------------------------------------------------------------
//   public functions
//-----------------------------------------------------------------------

// These functions compute the B-matrix given an interpolation matrix.

void                  get1DShapeGrads

  ( const Matrix&       b,
    const Matrix&       g );

void                  get2DShapeGrads

  ( const Matrix&       b,
    const Matrix&       g );

void                  get3DShapeGrads

  ( const Matrix&       b,
    const Vector&       g );

// A function that returns a pointer to a function that computes the
// B-matrix given the number of spatial dimensions.

ShapeGradsFunc        getShapeGradsFunc

  ( int                 rank );



#endif
